#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMqttClient>
#include <QWidget>
#include <QTcpSocket>
#include "pageone.h"
#include "pagetwo.h"
#include "pagethree.h"

#include <QMessageBox>

#include <QFile>
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

public slots:
    void setClientPort(int p);
    void connectPagethree();

private slots:

    void updateLogStateChange();

    void brokerDisconnected();
    
    void onTopicChanged();  // 主题变化时的处理

    void on_buttonQuit_2_clicked();

    void on_buttonSubscribe_2_clicked();

    void on_buttonConnect_2_clicked();

    void connectPageone();

    void connectPagetwo();




private:

    Ui::MainWindow *ui;
    QMqttClient *m_client;
    Pageone* pageone;
    pagetwo* page2;
    pagethree* page3;

};

#endif // MAINWINDOW_H
